#include <signal.h>
#include <iostream>
#include <sys/types.h>
#include <unistd.h>

void handler(int signo)
{
    std::cout << "----------------------------------" << std::endl;
    std::cout << "sig test, signo : " << signo << std::endl;
    std::cout << "----------------------------------" << std::endl;
}

int main()
{
    signal(SIGINT, handler);
    while(true)
    {
        std::cout << "pid is " << getpid() << std::endl;
        sleep(1);
    }
    return 0;
}